home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / ARGUMENT.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  826b  |  32 lines

  1. ' ARGUMENT.BAS
  2. ' This program demonstrates passing arguments to a subprogram.
  3.  
  4. DECLARE SUB AddInterest (monthName$, amount!)
  5.  
  6. month$ = "January"               ' initialize month$ with value
  7.                                  '   of "January"
  8. balance! = 1500                  ' initialize balance! with value of 1500
  9.  
  10. CLS
  11.  
  12. PRINT "Before subprogram:"       ' display original values
  13. PRINT "  month$ = "; month$
  14. PRINT "  balance! ="; balance!
  15. PRINT
  16.  
  17. AddInterest month$, balance!     ' call subprogram to modify values
  18.  
  19. PRINT "After subprogram:"        ' display modified values
  20. PRINT "  month$ = "; month$
  21. PRINT "  balance! ="; balance!
  22.  
  23. END
  24.  
  25. SUB AddInterest (monthName$, amount!)
  26.  
  27. monthName$ = "February"          ' change name of month
  28. amount! = amount! * 1.05         ' add 5% to amount
  29.  
  30. END SUB
  31.  
  32.